import type { ExtensibleEntityDto, ExtensibleObject } from '@abp/ng.core';
import type { DocumentStatus } from '../core/document-status.enum';
import type { SupplierDto } from '../suppliers/models';
import type { OperatorDto } from '../staff/models';
import type { AuxiliaryUnitDto, ItemMasterDto } from '../item-masters/models';

export interface PurchaseOrderCreateDto extends PurchaseOrderCreateOrUpdateBase {
  children: PurchaseOrderLineCreateOrUpdateDto[];
}

export interface PurchaseOrderCreateOrUpdateBase extends ExtensibleObject {
  tenantId?: string;
  orderTypeId?: string;
  supplierId?: string;
  operatorId?: string;
  mark?: string;
  code?: string;
  businessDate?: string;
  documentStatus: DocumentStatus;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
}

export interface PurchaseOrderDocumentDto extends ExtensibleEntityDto<string> {
  tenantId?: string;
  orderType: PurchaseOrderTypeDto;
  supplierId?: string;
  supplier: SupplierDto;
  operatorId?: string;
  operator: OperatorDto;
  mark?: string;
  code?: string;
  businessDate?: string;
  documentStatus: DocumentStatus;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
}

export interface PurchaseOrderDto extends ExtensibleEntityDto<string> {
  tenantId?: string;
  orderTypeId?: string;
  orderType: PurchaseOrderTypeDto;
  supplierId?: string;
  supplier: SupplierDto;
  operatorId?: string;
  operator: OperatorDto;
  mark?: string;
  code?: string;
  businessDate?: string;
  documentStatus: DocumentStatus;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
  children: PurchaseOrderLineDto[];
  concurrencyStamp?: string;
}

export interface PurchaseOrderLineCreateOrUpdateDto extends ExtensibleObject {
  id?: string;
  documentId?: string;
  itemMasterId?: string;
  itemCode?: string;
  itemName?: string;
  itemSpec?: string;
  quantity: number;
  remainingQuantity: number;
  unitId?: string;
  unitPrice: number;
  deliveryDate?: string;
  newDeliveryDate?: string;
  supplierDeliveryDate?: string;
  requireDeliveryDate?: string;
  lineNo: number;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
}

export interface PurchaseOrderLineDto extends ExtensibleEntityDto<string> {
  documentId?: string;
  document: PurchaseOrderDocumentDto;
  itemMasterId?: string;
  itemMaster: ItemMasterDto;
  itemCode?: string;
  itemName?: string;
  itemSpec?: string;
  quantity: number;
  remainingQuantity: number;
  unitId?: string;
  unit: AuxiliaryUnitDto;
  unitPrice: number;
  deliveryDate?: string;
  newDeliveryDate?: string;
  supplierDeliveryDate?: string;
  requireDeliveryDate?: string;
  lineNo: number;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
  concurrencyStamp?: string;
}

export interface PurchaseOrderTypeCreateDto extends PurchaseOrderTypeCreateOrUpdateBase {
}

export interface PurchaseOrderTypeCreateOrUpdateBase extends ExtensibleObject {
  tenantId?: string;
  displayName?: string;
  code?: string;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
}

export interface PurchaseOrderTypeDto extends ExtensibleEntityDto<string> {
  tenantId?: string;
  displayName?: string;
  code?: string;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
  concurrencyStamp?: string;
}

export interface PurchaseOrderTypeUpdateDto extends PurchaseOrderTypeCreateOrUpdateBase {
  concurrencyStamp?: string;
}

export interface PurchaseOrderUpdateDto extends PurchaseOrderCreateOrUpdateBase {
  concurrencyStamp?: string;
  children: PurchaseOrderLineCreateOrUpdateDto[];
}

export interface PurchaseRequisitionCreateDto extends PurchaseRequisitionCreateOrUpdateBase {
  children: PurchaseRequisitionLineCreateOrUpdateDto[];
}

export interface PurchaseRequisitionCreateOrUpdateBase extends ExtensibleObject {
  tenantId?: string;
  orderTypeId?: string;
  supplierId?: string;
  operatorId?: string;
  mark?: string;
  code?: string;
  businessDate?: string;
  documentStatus: DocumentStatus;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
}

export interface PurchaseRequisitionDocumentDto extends ExtensibleEntityDto<string> {
  tenantId?: string;
  orderType: PurchaseRequisitionTypeDto;
  supplierId?: string;
  supplier: SupplierDto;
  operatorId?: string;
  operator: OperatorDto;
  mark?: string;
  code?: string;
  businessDate?: string;
  documentStatus: DocumentStatus;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
}

export interface PurchaseRequisitionDto extends ExtensibleEntityDto<string> {
  tenantId?: string;
  orderTypeId?: string;
  orderType: PurchaseRequisitionTypeDto;
  supplierId?: string;
  supplier: SupplierDto;
  operatorId?: string;
  operator: OperatorDto;
  mark?: string;
  code?: string;
  businessDate?: string;
  documentStatus: DocumentStatus;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
  children: PurchaseRequisitionLineDto[];
  concurrencyStamp?: string;
}

export interface PurchaseRequisitionLineCreateOrUpdateDto extends ExtensibleObject {
  id?: string;
  documentId?: string;
  itemMasterId?: string;
  itemCode?: string;
  itemName?: string;
  itemSpec?: string;
  quantity: number;
  remainingQuantity: number;
  unitId?: string;
  unitPrice: number;
  deliveryDate?: string;
  lineNo: number;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
}

export interface PurchaseRequisitionLineDto extends ExtensibleEntityDto<string> {
  documentId?: string;
  document: PurchaseRequisitionDocumentDto;
  itemMasterId?: string;
  itemMaster: ItemMasterDto;
  itemCode?: string;
  itemName?: string;
  itemSpec?: string;
  quantity: number;
  remainingQuantity: number;
  unitId?: string;
  unit: AuxiliaryUnitDto;
  unitPrice: number;
  deliveryDate?: string;
  lineNo: number;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
  concurrencyStamp?: string;
}

export interface PurchaseRequisitionTypeCreateDto extends PurchaseRequisitionTypeCreateOrUpdateBase {
}

export interface PurchaseRequisitionTypeCreateOrUpdateBase extends ExtensibleObject {
  tenantId?: string;
  displayName?: string;
  code?: string;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
}

export interface PurchaseRequisitionTypeDto extends ExtensibleEntityDto<string> {
  tenantId?: string;
  displayName?: string;
  code?: string;
  sourceType?: string;
  sourceKey?: string;
  sourceCreatedOn?: string;
  isDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime?: string;
  creatorId?: string;
  concurrencyStamp?: string;
}

export interface PurchaseRequisitionTypeUpdateDto extends PurchaseRequisitionTypeCreateOrUpdateBase {
  concurrencyStamp?: string;
}

export interface PurchaseRequisitionUpdateDto extends PurchaseRequisitionCreateOrUpdateBase {
  concurrencyStamp?: string;
  children: PurchaseRequisitionLineCreateOrUpdateDto[];
}
